local wu__zhoufa = fk.CreateSkill{
  name = "wu__zhoufa",
}

Fk:loadTranslationTable{
  ["wu__zhoufa"] = "咒法",
  [":wu__zhoufa"] = "出牌阶段限一次，你可以弃置X张牌，对一名其他角色造成1点雷电伤害（X为你的体力值）。",

  ["#wu__zhoufa"] = "咒法：弃置当前体力值张数的牌，对一名其他角色造成1点雷电伤害",
}

wu__zhoufa:addEffect("active", {
  anim_type = "offensive",
  prompt = "#wu__zhoufa",
  target_num = 1,
  can_use = function(self, player)
    return player:usedSkillTimes(wu__zhoufa.name, Player.HistoryPhase) == 0
  end,
  card_filter = function(self, player, to_select, selected)
    return player.hp > #selected and not player:prohibitDiscard(to_select)
  end,
  target_filter = function(self, player, to_select, selected, selected_cards)
    return #selected == 0
    and to_select ~= player
    and player.hp == #selected_cards
  end,
  on_use = function(self, room, effect)
    local player = effect.from
    local target = effect.tos[1]
    room:throwCard(effect.cards, wu__zhoufa.name, player, player)
    if not target.dead then
      room:damage{
        from = player,
        to = target,
        damage = 1,
        damageType = fk.ThunderDamage,
        skillName = wu__zhoufa.name,
      }
    end
  end,
})

return wu__zhoufa